#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_

// QMSDAD35 Board configuration

#include <driver/gpio.h>

#define AUDIO_INPUT_REFERENCE    true
#define AUDIO_INPUT_SAMPLE_RATE  24000
#define AUDIO_OUTPUT_SAMPLE_RATE 24000

#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_47
#define AUDIO_I2S_GPIO_WS GPIO_NUM_13
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_14
#define AUDIO_I2S_GPIO_DIN  GPIO_NUM_21
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_12

#define AUDIO_CODEC_PA_PIN       GPIO_NUM_NC
#define AUDIO_CODEC_I2C_SDA_PIN  GPIO_NUM_5
#define AUDIO_CODEC_I2C_SCL_PIN  GPIO_NUM_4
#define AUDIO_CODEC_ES8311_ADDR  ES8311_CODEC_DEFAULT_ADDR
#define AUDIO_CODEC_ES7210_ADDR  ES7210_CODEC_DEFAULT_ADDR

// 功放控制引脚
#define PA_CTRL_PIN         (0x15)

// BOARD BASE PIN
#define BOARD_RESET_PIN     (0x16)
#define BOARD_I2C_SDA_PIN   (5)
#define BOARD_I2C_SCL_PIN   (4)

// AW9523
#define AW9523_I2C_SDA_PIN  (BOARD_I2C_SDA_PIN)
#define AW9523_I2C_SCL_PIN  (BOARD_I2C_SCL_PIN)
#define AW9523_REG_INPUT_P0      0x00
#define AW9523_REG_INPUT_P1      0x01
#define AW9523_REG_OUTPUT_P0     0x02
#define AW9523_REG_OUTPUT_P1     0x03
#define AW9523_REG_CONFIG_P0     0x04
#define AW9523_REG_CONFIG_P1     0x05
#define AW9523_REG_INT_P0        0x06
#define AW9523_REG_INT_P1        0x07
#define AW9523_REG_ID            0x10
#define AW9523_REG_CTL           0x11
#define AW9523_REG_LEDMODE_P0    0x12
#define AW9523_REG_LEDMODE_P1    0x13

// LCD PIN
#define LCD_BL_PIN          (-1)
#define LCD_BL_0_PIN        (0x10)
#define LCD_BL_1_PIN        (0x11)
#define LCD_BL_2_PIN        (0x12)
#define LCD_BL_3_PIN        (0x13)
#define LCD_BL_4_PIN        (0x00)
#define LCD_BL_5_PIN        (0x01)

#define LCD_BIT_PER_PIXEL (16)
#define LCD_DATA_WIDTH (8)

#define PIN_NUM_LCD_CS (-1)
#define PIN_NUM_LCD_DC (GPIO_NUM_45)
#define PIN_NUM_LCD_WR (GPIO_NUM_10)

#define PIN_NUM_LCD_DATA0 (GPIO_NUM_9)
#define PIN_NUM_LCD_DATA1 (GPIO_NUM_3)
#define PIN_NUM_LCD_DATA2 (GPIO_NUM_8)
#define PIN_NUM_LCD_DATA3 (GPIO_NUM_18)
#define PIN_NUM_LCD_DATA4 (GPIO_NUM_17)
#define PIN_NUM_LCD_DATA5 (GPIO_NUM_16)
#define PIN_NUM_LCD_DATA6 (GPIO_NUM_15)
#define PIN_NUM_LCD_DATA7 (GPIO_NUM_7)
#define PIN_NUM_LCD_DATA8 (-1)
#define PIN_NUM_LCD_DATA9 (-1)
#define PIN_NUM_LCD_DATA10 (-1)
#define PIN_NUM_LCD_DATA11 (-1)
#define PIN_NUM_LCD_DATA12 (-1)
#define PIN_NUM_LCD_DATA13 (-1)
#define PIN_NUM_LCD_DATA14 (-1)
#define PIN_NUM_LCD_DATA15 (-1)
#define PIN_NUM_LCD_RST (GPIO_NUM_NC)

#define BUILTIN_LED_GPIO        GPIO_NUM_NC
#define BOOT_BUTTON_GPIO        GPIO_NUM_0
#define VOLUME_UP_BUTTON_GPIO   GPIO_NUM_NC
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC

#define EXAMPLE_PIN_NUM_TOUCH_RST (GPIO_NUM_NC)
#define EXAMPLE_PIN_NUM_TOUCH_INT (GPIO_NUM_6)

#define DISPLAY_SDA_PIN GPIO_NUM_NC
#define DISPLAY_SCL_PIN GPIO_NUM_NC
#define DISPLAY_WIDTH   320
#define DISPLAY_HEIGHT  480
#define DISPLAY_MIRROR_X true
#define DISPLAY_MIRROR_Y false
#define DISPLAY_SWAP_XY false

#define DISPLAY_OFFSET_X  0
#define DISPLAY_OFFSET_Y  0

#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_NC
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true


#endif // _BOARD_CONFIG_H_
